package cn.jtfadmin.codegen.domain.dto;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.*;

/**
 * 实体模板数据
 */
@Getter
@Setter
public class EntityTempDataDTO implements Serializable {


    /**
     * 类信息
     */
    protected ClassDTO entityClass = null;


    /**
     * 表名
     */
    protected String tableName;

    /**
     * 字段信息
     */
    protected List<FieldDTO> fields= new ArrayList<>(0);

    /**
     * 父类信息
     */
    protected ClassDTO superClass = null;


    /**
     * 实现的接口
     */
    protected List<ClassDTO> interfaces=new ArrayList<>(0);

    /**
     * 验证和jpa导入的class
     */
    protected List<String> importClass = new ArrayList<>(0);



    protected String comment;

    @Getter
    @Setter
    public static  class FieldDTO extends cn.jtfadmin.codegen.domain.dto.FieldDTO implements Serializable{


        /**
         * 如果是集合时
         */
        protected ClassDTO collectionClass;



        /**
         * 列名
         */
        protected String columnName;


        /**
         * 唯一
         */
        protected Boolean unique;

        protected Boolean required;


        /**
         * lob
         */
        protected Boolean lob;

        /**
         *
         */
        protected Integer precision;


        protected Integer scale;


        protected Boolean oneToMany;

        protected Boolean manyToMany;

        protected Boolean manyToOne;


        protected Boolean oneToOne;


        protected String cascade;

        protected String fetch;


        protected String mappedBy;

        protected String joinTableName;


        protected String joinTableJcName;

        protected String joinTableIjcName;
        protected String joinColumnName;



    }

}
